package com.hui.jwt.service;

import com.hui.jwt.dao.UserDao;
import com.hui.jwt.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @BelongsProject: demo
 * @BelongsPackage: com.hui.jwt.service
 * @Author: HUI
 * @CreateTime: 2022-04-01 08:18
 * @Description:
 */

@Service
public class UserService {
    @Resource
    private UserDao userDao;

    public User login(User user) throws Exception {

        User userDB = userDao.selectById(user.getId());

        if (userDB!=null){
            return userDB;
        }

        throw new Exception("用户未找到");
    }

}
